package com.spark.lola.mapper.pur;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spark.lola.entity.pur.OrderInfo;
import com.spark.lola.support.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dengyejun
 * @since 2020-04-24
 */
@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
    @Override
    OrderInfo selectById(Serializable id);
    OrderInfo selectByNo(String no);
    IPage<OrderInfo> page(Page page, @Param(Constants.WRAPPER) Wrapper wrapper);

    IPage<OrderInfo> simplerPage(Page page, @Param(Constants.WRAPPER) Wrapper wrapper);

    Integer updateStartArea(@Param("orderId")Long orderId,@Param("area")String area);

    Integer updateEndArea(@Param("orderId")Long orderId,@Param("area")String area);

    List<Map<String, Object>> getSales(@Param("type")Integer type, @Param("byId") Long byId, @Param("start") String start, @Param("end") String end);

    BigDecimal getPaymentByStatus(@Param("type")Integer type,@Param("byId")Long byId,@Param("start") String start, @Param("end") String end);

    Integer getReturnCount(@Param("type")Integer type,@Param("byId")Long byId,@Param("start") String start, @Param("end") String end);

    BigDecimal getWaitingPaymentByStatus(@Param("type")Integer type,@Param("byId")Long byId,@Param("salesmanIds")Object[] salesmanIds,@Param("start") String start, @Param("end") String end);

    List<Map<String,Object>> getCountStatus(@Param("type")Integer type,@Param("byId")Long byId,@Param("salesmanIds")Object[] salesmanIds);
}
